package com.becca.cake.model.activity;

import java.io.Serializable;
import java.util.Date;

import com.becca.cake.core.exception.ServiceException;
import com.becca.cake.util.StringUtil;

/**
 * 宝宝市场活动实体
 * @copyright  尊星(上海)信息科技有限公司
 * @author hejinguo
 * @date 2016年10月20日 上午9:05:08
 */
public class ActivityBabyModel implements Serializable {
    /**  */
    private static final long  serialVersionUID           = 1712478019887911060L;

    /**姓名不能为空*/
    public static final String USER_NAME_IS_NULL          = "姓名不能为空";

    /**宝宝姓名不能为空*/
    public static final String BABY_NAME_IS_NULL          = "宝宝姓名不能为空";

    /**宝宝生日不能为空*/
    public static final String BABY_BIRTHDAY_IS_NULL      = "宝宝生日不能为空";

    /**宝宝星座不能为空*/
    public static final String BABY_CONSTELLATION_IS_NULL = "宝宝星座不能为空";

    /**宝宝性别不能为空*/
    public static final String BABY_SEX_IS_NULL           = "宝宝性别不能为空";

    /**信息不存在*/
    public static final String ACTIVITY_BABY_NOT_EXISTS   = "信息不存在";

    /**预测未来失败,请重新再试!*/
    public static final String ACTIVITY_BABY_FAULT        = "预测未来失败,请重新再试!";

    private Integer            id;

    private Byte               sex;

    private String             content;

    private Byte               isUsable;

    private Date               createdDate;

    private String             createdName;

    /**
     * 推测宝宝未来数据校验
     * @param userName
     * @param babyName
     * @param birthday
     * @param constellation
     * @param sex
     */
    public static void validateActivityBabyParam(String userName, String babyName, String birthday,
                                                 String constellation, Byte sex) {
        if (StringUtil.isEmpty(userName)) {
            throw new ServiceException(ActivityBabyModel.USER_NAME_IS_NULL);
        }
        if (StringUtil.isEmpty(babyName)) {
            throw new ServiceException(ActivityBabyModel.BABY_NAME_IS_NULL);
        }
        if (StringUtil.isEmpty(birthday)) {
            throw new ServiceException(ActivityBabyModel.BABY_BIRTHDAY_IS_NULL);
        }
        if (StringUtil.isEmpty(constellation)) {
            throw new ServiceException(ActivityBabyModel.BABY_CONSTELLATION_IS_NULL);
        }
        if (sex == null) {
            throw new ServiceException(ActivityBabyModel.BABY_SEX_IS_NULL);
        }
    }

    public Integer getId() {
        return id;
    }

    public Byte getSex() {
        return sex;
    }

    public String getContent() {
        return content;
    }

    public Date getCreatedDate() {
        return createdDate;
    }

    public String getCreatedName() {
        return createdName;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public void setSex(Byte sex) {
        this.sex = sex;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public void setCreatedDate(Date createdDate) {
        this.createdDate = createdDate;
    }

    public void setCreatedName(String createdName) {
        this.createdName = createdName;
    }

    public Byte getIsUsable() {
        return isUsable;
    }

    public void setIsUsable(Byte isUsable) {
        this.isUsable = isUsable;
    }

}
